<?php


namespace app\common\model;


use think\Model;

class Trade extends Model
{
//    public function getListPage($current_page=1,$num=10){
//        $count = $this->count();
//        $total = ceil($count/$num);
//        $res = $this->limit(($current_page-1)*$num,$num)->select();
//        $pageInfo = [
//            "current_page"=>$current_page,
//            "total"=>$total
//        ];
//        $result = [
//            'pageInfo' =>$pageInfo,
//            'list' => $res
//        ];
//        return $result;
//    }
    public function addTrade($date){
        $result = $this->save($date);
    }
    public function getTradeList(){
        $result = $this->select();
        return $result;
    }
    public function getTradeById($where){
        $result = $this->where($where)->find();
        return $result;
    }
    public function updateTrade($id,$data){
        $result = $this->where($id)->save($data);
        return $result;
    }

}